﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using COFE.Core;
using COFE.Core.Filter;

namespace COFE.Data
{
    public static class IDBEntryOperationProviderExtension
    {
        public static IEnumerable<Entry> ReadEntries(
            this IDBEntryOperationProvider provider,
            COFEDB2 context,
            string filterStr)
        {
            IEntryFilter[] entryFilters;
            IOptionFilter[] optionFilters;
            
            COFEShared.FilterParser.ParseFilter(filterStr,
                out entryFilters, out optionFilters);
            return provider.ReadEntries(context, entryFilters, optionFilters);
        }
    }
}
